<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>积分商城</title>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
<meta name="format-detection" content="telephone=no">
<meta name="renderer" content="webkit">
<meta http-equiv="Cache-Control" content="no-siteapp" />
<link rel="stylesheet" href="{$smarty.const.PUBLIC_PATH}css/amazeui.min.css"/>
<link rel="stylesheet" href="{$smarty.const.IMAGES_PATH}style.css"/>
<script src="{$smarty.const.PUBLIC_PATH}js/jquery.min.js"></script>
<script src="{$smarty.const.PUBLIC_PATH}js/amazeui.min.js"></script>
<style type="text/css">
/*page*/
.pagin{ position:relative;margin-top:10px;padding:0 12px;height: 31px;}
.pagin .blue{ color:#056dae;font-style:normal;}
.pagin .paginList{ position:absolute;right:12px;top:0;margin-top: 0px;}
.pagin .paginList .paginItem{ float:left;}
.pagin .paginList .paginItem a{ float:left;width:31px;height:28px;border:1px solid #DDD !important;font-size: 9pt;text-align:center;line-height:30px;border-left:none;color:#3399d5;}
.pagin .paginList .paginItem:first-child a{ border-left:1px solid #DDD;}
.pagin .paginList .paginItem:first-child a{ border-bottom-left-radius:5px;border-top-left-radius:5px;}
.pagin .paginList .paginItem:last-child a{ border-bottom-right-radius:5px;border-top-right-radius:5px;}
.pagin .paginList .paginItem.current,.pagin .paginList .paginItem.current a{ background:#f5f5f5; cursor:default;color:#737373;}
.pagin .paginList .paginItem:hover{ background:#f5f5f5;}
.pagin .paginList .paginItem.more,.pagin .paginList .paginItem.more a:hover{ cursor:default;}
.pagin .paginList .paginItem.more:hover{ background:#FFF;}
.pagin .paginList .paginItem.more a{ color:#737373;font-size: 9pt;}
.pagin .paginList .paginItem input{
	    font-size: 9pt;
    border: 0;
    margin: 0;
    padding: 0;
}
li {
    display: block;
    margin: 0;
    padding: 0;
    list-style: none;
}
.btn {
    width: 137px;
    height: 35px;
    background: url({$smarty.const.ADMIN_IMAGES_PATH}btnbg.png) no-repeat;
    font-size: 14px;
    font-weight: bold;
    color: #fff;
    cursor: pointer;
    border: 0;
    margin: 0;
    padding: 0;
    margin-left: 2px;
}

</style>
</head>

<body>
<div class="container">
	<!--引入头文件-->
	{include file="../header.html"}
	<script>$('.title-link').text("我的订单")</script>
	
    <div class="am-cf cart-panel" style="min-height: 600px;">
    	{foreach $orders as $k=>$v}
    	
    	<div class="withdrawals-panel">
        	<p class="groupby-t-p"><span class="am-fr">{date("Y-m-d H:i:s",$v.create_time)}</span>订单号：{$v.uid}</p>
            <hr  class="am-divider am-divider-default am-cf"/>
            {foreach json_decode($v.goods,true) as $gk=>$gv}
            <a href="{$smarty.const.__MODULE__}/IntegralGoods/goodsdetail/id/{$gv.good.id}">
            <div style="width: 100%;height: 215px; display: block;position: relative;">
            	<div class="groupby-img-panle" style="position: absolute;left: 0;"><img src="{$gv.good.main_img}" class="am-img-responsive" /></div>
            	<div class="groupby-info-panle">
            		<h3>{$gv.good.name}</h3>
            	    <p>价格：<span class="red2 bold">{$gv.good.price}</span> 积分</p>
            	    <p>数量：{$gv.quantity}</p>
            	    {$address=json_decode($v.address,true)}
            	    <p>收货地址:<i class="am-icon-user"></i>{$address.name}<i class="am-icon-phone" style="margin-left: 30px;"></i>{$address.phone}</p>
            	    <p>{$address.province}{$address.city}{$address.town}{$address.detail}</p>
            	    {if $v.status==3}
		        		<p style="float: right;"><a href="{$smarty.const.__CONTROLLER__}/tocomment/uid/{$v.uid}/goods_uid/{$gv.good.id}" class="am-btn am-btn-primary am-btn-xs am-btn-success am-radius" style="background-color: lightskyblue;border-color: lightskyblue;">去评价</a> </p>
		        	{/if}
            	</div>
            	
            </div>
            </a>
            {/foreach}
            
            
            <!--<p style="float: right;">状态：<span class="am-text-success">已付款</span></p>-->
            {if $v.status==1}
            <p style="float: right;"><a class="am-btn am-btn-primary am-btn-xs am-btn-success am-radius">待发货</a><a href="{$smarty.const.__CONTROLLER__}/torefund/uid/{$v.uid}" class="am-btn am-btn-primary am-btn-xs am-btn-warning am-radius" style="margin-left: 10px;margin-right: 10px;">申请退款</a></p>
        	{else if $v.status==2}
        	<p style="float: right;">快递信息:{$v.delivery_name}{$v.delivery_id} <a data-uid="{$v.uid}" class="am-btn am-btn-primary am-btn-xs am-btn-success am-radius receivegoods" style="background-color: orange;border-color: orange;">确认收货</a> </p>
        	{else if $v.status==4}
        	<p style="float: right;"><a class="am-btn am-btn-primary am-btn-xs am-btn-danger am-radius" >申请退款中</a> </p>
        	{else if $v.status==5}
        	<p style="float: right;"><a class="am-btn am-btn-primary am-btn-xs am-btn-danger am-radius" >商家拒绝退款</a> </p>
        	{else if $v.status==6}
        	<p style="float: right;"><a class="am-btn am-btn-primary am-btn-xs am-btn-success am-radius" style="background-color: lightskyblue;border-color: lightskyblue;">已完成</a> </p>
        	{else if $v.status==7}
        	<p style="float: right;"><a class="am-btn am-btn-primary am-btn-xs am-btn-danger am-radius" >已退款</a> </p>
        	{/if}
    	</div>
        {/foreach}
       
		<!--<ul class="am-pagination am-pagination-centered">
          <li class="am-disabled"><a href="#">&laquo;</a></li>
          <li class="am-active"><a href="#">1</a></li>
          <li><a href="#">2</a></li>
          <li><a href="#">3</a></li>
          <li><a href="#">4</a></li>
          <li><a href="#">5</a></li>
          <li><a href="#">&raquo;</a></li>
        </ul>-->
        <div class="pagin">
    	<div class="message">共<i class="blue">{$total}</i>条记录，每页显示&nbsp;<i class="blue">10&nbsp;</i>条</div>
        <ul class="paginList">
        	{$pagelist}
        </ul>
    </div>
    </div>
    
    <footer data-am-widget="footer" class="am-footer am-footer-default" data-am-footer="{  }">
        <hr data-am-widget="divider" style="" class="am-divider am-divider-default"/>
      <div class="am-footer-miscs ">
        <p>CopyRight©2014 AllMobilize Inc.</p>
        <p>京ICP备13033158</p>
      </div>
    </footer>
    <!--底部-->
    {include file="../footer.html"}
</div>
    <script type="text/javascript">
    	$('.receivegoods').click(function(){
    		//alert($(this).data('uid'))
    		if(confirm("您确定收货吗？")){
    			var data={
    			uid:$(this).data('uid'),
    			}
	    		$.post("{$smarty.const.__CONTROLLER__}/receivegoods", data, function(ret){
					console.log(ret);
					if(ret.errorcode){
						alert(ret.error);
					}else{
						window.location.reload();
					}
				})
    		}
    	})
    </script>
</body>
</html>
